1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and an apparatus for improving boot ROM and operating system initialization. Still more particularly, the present invention provides a method to accurately measure time durations for tasks during system initialization.
2. Description of the Related Art
An operating system (OS) is essential for any general-purpose computer. The OS provides the fundamental layer of software between the user or application program and the computer hardware. Some of the services provided by a typical operating system are program execution, input/output (I/O) operations, file-system manipulation, communication, error detection, resource allocation, accounting, and protection. A typical OS may be command-line oriented (e.g., AIX, Advanced Interactive Executive) or windows-oriented (e.g., OS/2).
Loading and running the operating system is accomplished by using a bootstrap program. Normally, starting the OS is a two step process. There is a xe2x80x9csimplexe2x80x9d boot program that is usually stored in the system ROM (Read Only Memory). This program needs no initialization. The job of the ROM boot program is to initialize registers in the CPU (Central Processing Unit), initialize device controllers, such as for the system disk and memory, and initialize memory contents. The ROM boot program can read and write to memory and can load from a boot block oh the system disk. This boot block contains a more complex boot program that actually loads the operating system itself.
An operating system (OS) is a large, complex program that provides a wide variety of services. The entire OS need not be resident in memory at all times. However there is a small kernel that is always resident in main memory. The kernel does not run as a thread (a stream of execution) and so it cannot be pre-empted. The kernel cannot be paged out to disk, that is, it cannot be removed from memory and written to the swap space on a disk. The kernel contains the most frequently used functions in the operating system, including thread scheduling, process switching, exception and interrupt handling, and multiprocessor synchronization.
The job of the xe2x80x9ccomplexxe2x80x9d boot program loaded from the boot block on the system disk is to locate the operating system kernel, load the kernel into memory, and then transfer instruction control to the initial address in the kernel. The operating system itself goes through initialization, as users can observe by periodic status messages appearing on the screen. Depending on the size of the operating system and complexity of the computer system, this process can take tens of seconds, minutes, or even tens of minutes. In order to improve this initialization process, it would be advantageous to have precise timing measurements for each of the tasks in the initialization process.
Typically the initialization routines for each of the processes or devices have not been written with xe2x80x9cinstrumentationxe2x80x9d code that allows timing of the code itself. Instrumenting each piece of code would be time consuming and dangerous if, as a result, the code does not function properly. In the past, xe2x80x9cad hocxe2x80x9d techniques have been used to provide timings for each of the initialization steps. A pencil, paper, and stopwatch does not provide accurate readings, particularly on a modern system with the CPU clock speed in the hundreds of millions of instructions per second. Although initialization can be laborious, many steps occur too quickly to allow for hand measurements. Capturing screen images or other initialization indications internally during initialization is not feasible since access to system resources for storage may not be available yet. Externally videotaping the screen is possible, but this is a cumbersome process and readings may not be any more accurate than the stopwatch method.
Therefore, it would be advantageous to have a method and apparatus to perform the system initialization timing measurements in an unobtrusive, accurate, and automated manner.
The present invention discloses a method and apparatus to provide accurate and automated timing of firmware routines, such as initialization tasks at boot time. Since each task sends a progress indicator code to a display buffer when it starts to run, by saving processor time stamps at the time these codes change, it is possible to calculate and store the time duration for each routine. In the case of system initialization, these time durations can be an indication of problems if they are much longer than normal or an indication of excessive, inefficient, or ineffective processing that might be speeded up in order to reduce the total boot time.